# -*- coding:utf-8 -*-

import traceback,time
from multiprocessing.managers import BaseManager
class QueueManager(BaseManager):
    pass
def connect_queue_db_send_web(**kwargs):
    while True:
        try:
            QueueManager.register('db_send_web')
            manager = QueueManager(address=('127.0.0.1',9991), authkey=b'erfsad')
            manager.connect()
            return manager.db_send_web()
            break
        except Exception as e:
            if kwargs.get('self') is not None:
                kwargs['self'].log.printerror('队列db_send_web无法连接:',str(traceback.format_exc()))
            time.sleep(1)
def connect_queue_web_send_db(**kwargs):
    while True:
        try:
            QueueManager.register('web_send_db')
            manager = QueueManager(address=('127.0.0.1',9992), authkey=b'fsdsa')
            manager.connect()
            return manager.web_send_db()
            break
        except Exception as e:
            if kwargs.get('self') is not None:
                kwargs['self'].log.printerror('队列db_send_web无法连接:',str(traceback.format_exc()))
            time.sleep(1)
